home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 1644
- ClientLeft = 48
- ClientTop = 276
- ClientWidth = 4644
- LinkTopic = "Form1"
- ScaleHeight = 1644
- ScaleWidth = 4644
- StartUpPosition = 3 'Windows Default
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Load()
- Dim htmlCode As String
- Dim curURL As String
- Dim tagArray() As HTMLTag
- ' htmlCode is a string containing the html source code
- ' you want to parse. This can be retrieved by either
- ' reading in a local file or by downloading a file from
- ' the internet. This is left up to the programmer to do.
- htmlCode = "<HTML><BODY>Hi.</BODY></HTML>"
- ' curURL is used when a relative file name is encountered
- ' such as in a link or IMG tag. For exmaple:
- ' <IMG SRC="../img/header.gif">
- ' In order for this URL to be affective, you will need to make
- ' it into a fully qualified URL by prepending curURL to it
- ' to form: http://www.yahoo.com/../img/header.gif"
- curURL = "http://www.yahoo.com/"
- HTMLParse htmlCode, curURL, tagArray
- ' Now tagArray is filled with the tags
- ' Lets print some items to the form
- ' showing off our new found knowledge
- Print UBound(tagArray); " tags were found in htmlCode$"
- Print tagArray(0).Full; " is the first tag I found in htmlCode$"
- Print tagArray(UBound(tagArray) - 1).Full; " is the last tag I found in htmlCode$"
- End Sub
-